<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Hash;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class ServiceController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    

    /*
        前台客服中心首页
    */
         public function getService()
        {
            // echo "2222222";
          $qsn = DB::table('service_qsn')->get();
          $cate = DB::table('service_cate')->get();
          $part = DB::table('service_part')->get();

         
          // dd($res);
          return view('home.service.service',['qsn'=>$qsn,'cate'=>$cate,'part'=>$part]);  
            
        }

    /*
        前台客服中心选中分块详情页
    */
         public function getCate(Request $request)
        {
          $lu = $request->all();
            // dd($lu);
          $qsn = DB::table('service_qsn')->get();
          $cate = DB::table('service_cate')->get();
          $part = DB::table('service_part')->get();

          $c = DB::table('service_cate')->where('id',$lu['cid'])->first();
          
          // dd($res);
          return view('home.service.cate',['qsn'=>$qsn,'cate'=>$cate,'part'=>$part,'c'=>$c]); 
            
        }



    /*
        前台客服中心选中问题详情页
    */
         public function getQsn(Request $request)
        {
          $res = $request->all();
         
          $qsn = DB::table('service_qsn')->get();
          $cate = DB::table('service_cate')->get();
          $part = DB::table('service_part')->get();

         $q = DB::table('service_qsn')->where('id',$res['id'])->first();
       
          return view('home.service.qsn',['qsn'=>$qsn,'cate'=>$cate,'part'=>$part,'q'=>$q]);  
            
        }

    /*
        前台客服中心用户提问页
    */

         public function getUserqsnadd(Request $request)
        {
          $res = $request->all();
         
          $qsn = DB::table('service_qsn')->get();
          $cate = DB::table('service_cate')->get();
          $part = DB::table('service_part')->get();

         
       
          return view('home.service.userqsnadd',['qsn'=>$qsn,'cate'=>$cate,'part'=>$part]);  
            
        }
    /*
        前台客服中心用户提问执行
    */
        public function postDousqsnadd(Request $request)
        {
          dd($request->all());
        }

}
